home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / appkit.33 < prev    next >
Text File  |  1992-02-06  |  2KB  |  42 lines

  1. {\rtf0\ansi{\fonttbl\f2\fnil Times-Roman;\f0\fmodern Courier;}
  2. \paperw13040
  3. \paperh10200
  4. \margl120
  5. \margr120
  6. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f2\b0\i0\ul0\fs28 arbitrary view trasnparent windows\
  7. \
  8. Q:  How can I make a non-rectangular Window?\
  9. Q:  How can I make a non-rectangular View?\
  10. \
  11. A:  You cannot at present make a non-rectangular Window.  We hear the request.  Tell us how important is this ability compared with your other needs.   The WhatADrag example on the 2.0 release (/NextDeveloper/Examples/WhatADrag) shows you how to create windows with transparency for dragging arbitrary shapes on the screen between windows.  This is not true transparent windows, but it does most of what developers need transparent windows for.\
  12. \
  13. A: You can clip a View to a non-rectangular shape by creating a subclass of View, and overriding the following View method to establish your own clipping path.\
  14. \
  15.  
  16. \f0\fs24 - clipToFrame:(NXRect *) frameRect\
  17.  /*\
  18.   * TYPE: Focusing and displaying; Clips to frame during focusing \
  19.   *\
  20.   * This method is provided to allow for your View to do arbitrary clipping\
  21.   * during focusing.  This method is called from within the focusing\
  22.   * machinery if clipping is required.  The default implementation just\
  23.   * calls PSrectclip with the values in frameRect. You must use frameRect\
  24.   * rather than just looking at your View's frame instance variable,\
  25.   * because due to focusing, the origins may not be the same. \
  26.   */\
  27. \{\
  28.     PSrectclip(NX_X(frameRect), NX_Y(frameRect),\
  29.            NX_WIDTH(frameRect), NX_HEIGHT(frameRect));\
  30.     return self;\
  31. \}\
  32. \
  33. \
  34.  
  35. \f2\fs28 \
  36. QA33\
  37. \
  38. Valid for 1.0\
  39. Valid for 2.0\
  40. \
  41.  
  42.